package duoqiao;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;

public class A7 {


    public static void main(String[] args) {
        try {
            read("D:\\a.txt.txt");
        }catch (FileNotFoundException | FileTypeException1 e){
            e.printStackTrace();
        }
    }
    public static String read(String path) throws FileNotFoundException, FileTypeException1 {
//        File file = new File("D:\\a.txt.txt");
//        if (file.exists()){
        if (!new File(path).exists()){
            throw new FileNotFoundException("文件路径找不到");
        }
        if (!path.endsWith("t")){
            throw new FileTypeException1("后缀名错");
        }
        return null;
    }
}
class FileTypeException1 extends Throwable {//写类就记住写构造方法,

    public FileTypeException1(){

    }

    public FileTypeException1(String name){

        /*
        super.变量
        super():调用构造方法
        super.方法名():调用普通方法
         */

        super(name);
    }

}
